function dungeonLayer(index){
	this.index 		= index; 			//index of layer
	this.selected 	= false;		//if layer is currently selected
	
	this.matrix		= new matrix(index,totalRows,totalCols);
	this.matrix		= this.matrix.matrix;
	
	this.buildTable = function(){
		$.ajax({
			type: "GET",
			url: "ajax/table.php",
			data: "lang="+globalLanguage,
			success: function(response){
				var obj = JSON.parse(response);
				
				var tableCode = trCode = "";
				for (var i=0;i<totalRows;i++){
					trCode += obj.tr;
					var tdCode = "";
					for (var j=0;j<totalCols;j++){
						tdCode += obj.td;
						tdCode = tdCode.replace('[[content]]','');
						tdCode = tdCode.replace('[[id]]',(currentTotalLayer-1)+'-'+j+'-'+i);
					}
					trCode = trCode.replace('[[cols]]',tdCode);
				}
				tableCode = obj.header;
				tableCode = tableCode.replace('[[rows]]',trCode);
				$('#dungeonTable').html(tableCode);
			}
		});
	};
	
	this.push = function(x,y){
		this.matrix[x][y].push(currentTile);
	};
		
} 